Skip to content

cannot pr after i push #160951

Discussion options

You must be logged in to vote

This usually happens when your branch isn't based on the latest commit history of the upstream repository. If your fork is significantly behind the original repository (the upstream), or if your branch doesn’t share a common ancestor with the base branch, GitHub can’t generate a valid comparison for a PR.

To resolve this:

First, sync your fork with the upstream:

bash
Copy
Edit
git remote add upstream https://github.com/original/repo.git
git fetch upstream
git rebase upstream/main # or merge, depending on the project's policy
Push the updated branch:

bash
Copy
Edit
git push -f origin your-branch
Now GitHub should recognize the shared history and allow the pull request

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by teroid-xo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Requests Propose, review, and discuss changes to a repository's codebase Question Ask and answer questions about GitHub features and usage
2 participants